﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GLYFrom.DengLu
{
    public partial class ZhaoHuiMM : Form
    {
        public ZhaoHuiMM()
        {
            InitializeComponent();
        }

        private void label8_Click(object sender, EventArgs e)
        {
            DengLu.denglu from = new denglu();
            from.Show();
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string ZhangHao = this.text_ZhangHao.Text.Trim();
            string MiMa = this.text_MiMa.Text.Trim();
            string SJH = this.text_SJH.Text.Trim();
            DataTable table = DBHelper.select(string.Format("select * from T_YongHu where ZhangHao='{0}' and DianHua='{1}'",ZhangHao,SJH));
            if (table.Rows.Count>0)
            {
                if (ZhangHao.Length > 0 && MiMa.Length > 0 && SJH.Length > 0)
                {
                    int sr = DBHelper.ZSG(string.Format("update T_YongHu set MiMa='{0}' where ZhangHao='{1}' and DianHua='{2}'", ZhangHao, MiMa, SJH));
                    if (sr > 0)
                    {
                        MessageBox.Show("修改成功！");
                    }
                    else
                    {
                        MessageBox.Show("修改失败！");
                        return;
                    }
                }
                else
                {
                    MessageBox.Show("修改失败,请填写完整...");
                    return;
                }
            }
            else
            {
                MessageBox.Show("修改失败,账号或手机号不正确...");
                return;
            }
        }
    }
}
